package com.furcas.javaee6.rainbow;

import javax.ejb.embeddable.EJBContainer;
import javax.naming.Context;
import javax.naming.NamingException;

public class Main {

	/**
	 * @param args
	 * @throws NamingException
	 */
	public static void main(String[] args) throws NamingException {
		User user = new User();
		user.setUserId("test");
		user.setName("Test User");
		user.setEmail("test@example.com");
		EJBContainer ec = EJBContainer.createEJBContainer();
		Context ctx = ec.getContext();
		UserBean userBean = (UserBean) ctx
				.lookup("java:global/classes/UserBean");
		userBean.createUser(user);
		ec.close();
	}

}
